package tweeter;
import java.util.Calendar;

@SuppressWarnings("rawtypes") // TODO: Ma ze?
public class Tweet implements Comparable
{
	@Override
	public String toString()
	{
		return "[" + tweeterID + "]" + " " + tweetTimestamp + " : " + tweetData;
	}

	public Integer tweeterID;
	public Calendar tweetTimestamp;
	public String tweetData;

	public Tweet(Integer tweeterID, Calendar tweetTimestamp, String tweetData)
	{
		super();
		this.tweeterID = tweeterID;
		this.tweetTimestamp = tweetTimestamp;
		this.tweetData = tweetData;
	}
	
	@Override
	public int compareTo(Object compared) throws ClassCastException
	{
	    if (!(compared instanceof Tweet))
	    {
	        throw new ClassCastException("Not an instance of Tweet");
	    }
		
	    Tweet comparedTweet = (Tweet)compared;
	    return this.tweetTimestamp.compareTo(comparedTweet.tweetTimestamp);
	}
}
